﻿@inject NavigationManager NavigationManager
@inject ILogger<Toolbar> logger

<div>
    <button title="Config and Tasks" @onclick="@(() => ShowConfigDialog())" class="btn btn-primary">
        <i class="fa fa-cogs"/>
    </button>
</div>
<div>
    <button title="About Damselfly..." @onclick="@(() => ShowAboutDialog())" class="btn btn-primary">
        <i class="fa fa-info-circle"/>
    </button>
</div>

@code
{
    private void ShowConfigDialog()
    {
        try
        {
            NavigationManager.NavigateTo("/config");
        }
        catch( Exception ex )
        {
            logger.LogError("Exception: " + ex.Message);
        }
    }

    private void ShowAboutDialog()
    {
        try
        {
            NavigationManager.NavigateTo("/info");
        }
        catch( Exception ex )
        {
            logger.LogError("Exception: " + ex.Message);
        }
    }
}